<?php 
    use Zend\Escaper\Escaper;    
?>

<div class="authentication_anchor">
    <?php 
        $escaper = new Escaper('utf-8');
    
        if ($this->customer == null) {
            // Customer is not logged in
            echo '<a href="'.$this->url('user', array('controller' => 'authentication', 'country' => $this->country, 'action' => 'authenticate'), array('query' => array('url' => $escaper->escapeUrl($this->currentUrl)))).'">'. $this->translate('Login', 'user', $this->locale) .'</a>'; 
        } else {
            // Customer is logged in
            echo '<div class="welcome">'.$escaper->escapeHtml($this->translate('Welcome', 'user', $this->locale) . ', '.$this->customer->getUsername()).'</div><a href="'.$this->url('user', array('controller' => 'authentication', 'country' => $this->country, 'action' => 'deauthenticate'), array('query' => array('url' => $escaper->escapeUrl($this->currentUrl)))).'">'. $this->translate('Logout', 'user', $this->locale) .'</a>';
        }
    ?>
</div>
